<app-common-header [title]="'auth.reset-pwd.input-verification-code.title' | translate"></app-common-header>
<ion-content>
<div class="login_content">
  <form [formGroup]="validateForm" name="validateForm" role="form" (ngSubmit)="toInputPassword()">
  <ion-grid>
    <ion-row>
      <ion-col>
        <ion-label class="login_title">
          {{'auth.reset-pwd.input-verification-code.resetpwd' | translate}}
        </ion-label>
      </ion-col>
    </ion-row>
    <ion-row>
      <ion-col>
        <ion-header class="login_word">
          {{'auth.reset-pwd.input-verification-code.please_enter_code' | translate}}
        </ion-header>
      </ion-col>
    </ion-row>
    <ion-row>
      <ion-col>
        <ion-grid>
          <ion-row class="login_input">
            <ion-col size="9">
              <ion-input type="number" size=20 placeholder="{{'auth.reset-pwd.input-verification-code.code' | translate}}" clearInput="true" required autofocus formControlName="verificationCode"></ion-input>
            </ion-col>
            <ion-col size="3" class="send_words" *ngIf="!sendView">
              <span>{{'auth.reset-pwd.input-verification-code.resend' | translate}} {{smsCountDown}}s</span>
            </ion-col>
            <ion-col size="3" class="send_btn" *ngIf="sendView">
              <ion-button class="send_btn" fill="clean" size="small" (click)="sendAppVerificationCode()">
                {{'auth.reset-pwd.input-verification-code.send' | translate}}
              </ion-button>
            </ion-col>
          </ion-row>
          <ion-row *ngIf="verificationCode.invalid && (verificationCode.dirty || verificationCode.touched)">
            <ion-col size="12">
              <div *ngIf="verificationCode.errors.required" class="form-error-item">
                {{'auth.reset-pwd.input-verification-code.code_required' | translate}}
              </div>
            </ion-col>
          </ion-row>
        </ion-grid>
      </ion-col>
    </ion-row>
    <ion-row>
      <ion-col>
        <ion-button class="customer-btn" fill="clear" expand="block" type="submit" [disabled]='validateForm.invalid || loading'>
          {{'auth.reset-pwd.input-verification-code.next' | translate}}
          <ion-spinner [hidden]="!loading"></ion-spinner>
        </ion-button>
      </ion-col>
    </ion-row>
  </ion-grid>
</form>
</div>
</ion-content>

